package com.yztc.yidoutang.activity.register_activity;

import android.app.Activity;
import android.content.Context;
import android.widget.Button;
import android.widget.EditText;

/**
 * 注册界面中相当于MVP中Presenter层的类
 */
public class RegisterPresenter implements RegisterContract.Presenter {
    private RegisterContract.Model model;
    private RegisterContract.View view;

    public RegisterPresenter(RegisterContract.View view) {
        this.view = view;
        this.model = new RegisterModel();
    }

    @Override
    public void onEditTextTextChanged(Context context, String type, String text, Button register) {
        model.onEditTextTextChanged(context, type, text, register);
    }

    @Override
    public void onPostCodeClicked(Activity activity, EditText phone, Button post) {
        model.onPostCodeClicked(activity, phone, post);
    }

    @Override
    public void onShowHidePswClicked(EditText psw, boolean isChecked) {
        model.onShowHidePswClicked(psw, isChecked);
    }

    @Override
    public void onRegisterClicked(EditText phone, EditText code, EditText psw) {
        model.onRegisterClicked(phone, code, psw);
    }

    @Override
    public void onBackClicked(Activity activity) {
        model.onBackClicked(activity);
    }
}